//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
import composite.AbstractFile;
import composite.File;
import composite.Folder;
import wxy.composite.*;

public class Main {
    public static void main(String[] args) {
        //TIP 当文本光标位于高亮显示的文本处时按 <shortcut actionId="ShowIntentionActions"/>
        // 查看 IntelliJ IDEA 建议如何修正。
        System.out.println("测试组合模式!");
        AbstractFile file1 = new File();
        AbstractFile file2 = new File();
        AbstractFile folder1 = new Folder();
        folder1.add(file1);
        folder1.add(file2);
        AbstractFile folder2 = new Folder();
        folder2.add(new File());
        folder2.add(folder1);
        folder2.add(new File());
        AbstractFile folder3 = new Folder();
        folder3.add(new File());
        folder3.add(folder2);
        folder3.KillVirus();

    }
}